import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'
import Seller from './views/Seller'
import Buyer from './views/Buyer'
import AddBuyer from './views/AddBuyer'
import Article from './views/Article'
import P1 from './views/P1'
import P2 from './views/P2'
import P3 from './views/P3'

Vue.use(Router);
const routes = [
    {
        path: '/',
        redirect: '/home',
        //通过设置是否隐藏来取消一些渲染，默认等于不隐藏
        groupIndex: 0,
    },
    {
        path: '/home',
        component: Home,
        //添加一个字段来友好的描述页面内容
        description:'主页',
        groupIndex: 1,
    },
    {
        path: '/seller',
        component: Seller,
        description: '卖家页面',
        groupIndex: 1,

    },
    {
        path: '/buyer',
        component: Buyer,
        description: '买家页面',
        groupIndex: 1,

    },
    {
        path: '/add-buyer',
        component: AddBuyer,
        description: '买家新增页面',
        groupIndex: 1,

    },
    {
        path: '/article',
        component: Article,
        description: '商品管理页面',
        groupIndex: 1,

    },
    {
        path: '/',
        description: '交易管理页面',
        groupIndex: 2,
    },
    {
        path: '/p1',
        component: P1,
        description: '第一练习场',
        groupIndex: 2,
    },
    {
        path: '/p2',
        component: P2,
        description: '第二练习场',
        groupIndex: 2,
    },
    {
        path: '/p3',
        component: P3,
        description: '第三练习场',
        groupIndex: 2,
    },
];


export default new Router({routes: routes});
